<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="border-hover-style" style="display: flex">
      <div
        class="content-parent"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style12/Level2outlineStyle3Bg.webp'})`,
        }"
      >
        <div class="digitalShowroom-p" v-if="props.info.digitalShowroom">
          <digitalShowroomIcon :url="props.info.digitalShowroom" />
        </div>

        <div
          class="content"
          :class="{
            content3: !props.info.value && !props.info.remarks && props.info.subTitle,
            content2: !props.info.value && !props.info.remarks && !props.info.subTitle,
          }"
        >
          <div class="title-box">
            <div
              class="title-top"
              :style="{
                backgroundImage: `url(${publicUrls + 'free/style12/Level2outlineStyle3titleBg1.webp'})`,
              }"
            ></div>
            <div
              class="title-center"
              :style="{
                backgroundImage: `url(${publicUrls + 'free/style12/Level2outlineStyle3titleBg2.webp'})`,
              }"
            >
              <span>{{ props.info.text }}</span>
            </div>
            <div
              class="title-bottom"
              :style="{
                backgroundImage: `url(${publicUrls + 'free/style12/Level2outlineStyle3titleBg3.webp'})`,
              }"
            ></div>
          </div>
          <div class="content-right">
            <p class="subtitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
            <div
              class="img-box"
              :class="{
                'img-box1': props.info.remarks && !props.info.subTitle,
                'img-box2': !props.info.remarks && props.info.subTitle,
                'img-box3': !props.info.remarks && !props.info.subTitle,
              }"
              v-if="props.info.value"
            >
              <div class="outline-cover">
                <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
              </div>
            </div>
            <div class="remarks1" v-if="props.info.value">
              <TextMax
                :infoData="props.info"
                v-if="props.domShow"
                :data="props.info.remarks"
                :title="props.info.text"
                :row="6"
              ></TextMax>
            </div>
            <div
              class="remarks2"
              :class="{
                remarks3: !props.info.subTitle,
              }"
              v-else-if="props.info.remarks"
            >
              <TextMax
                :infoData="props.info"
                v-if="props.domShow"
                :data="props.info.remarks"
                :title="props.info.text"
                :row="props.info.subTitle ? 12 : 14"
              ></TextMax>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free12Style3',
});
</script>

<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style12.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax12.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
  indexs: {
    type: Number || String,
  },
});
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  position: relative;
  margin-left: 40px;
  margin-top: 0;
  height: 100%;
}
.content-parent {
  display: flex;
  position: relative;
  width: 720px;
  height: 774px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.digitalShowroom-p {
  display: flex;
  position: absolute;
  top: 35px;
  right: 234px;
  z-index: 15;
  width: 54px;
  height: 51px;
}
.content {
  display: flex;
  // flex-direction: column;
  width: 720px;
  z-index: 6;
  position: relative;
  padding-right: 205px;
  padding-top: 4px;
}
.content2 {
  display: flex;
  .content-right {
    display: none;
  }
  .title-box {
    margin-left: 243px;
  }
}
.content3 {
  .subtitle {
    margin-top: 205px;
  }
}
.title-box {
  display: flex;
  flex-direction: column;
  width: 90px;
  margin-top: 4px;
  margin-left: 43px;
  .title-top,
  .title-bottom {
    width: 90px;
    height: 41px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
  .title-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px 27px;
    padding-left: 27px;
    padding-right: 0px;
    min-height: 242px;
    height: auto;
    background-size: 100% 100%;
    background-repeat: repeat;
    margin-top: -1px;
    span {
      width: 24px;
      writing-mode: vertical-rl;
      text-orientation: upright;
      font-family: Alimama DongFangDaKai;
      font-size: 24px;
      font-weight: 400;
      line-height: 29px;
      text-align: center;
      // letter-spacing: -0.1em;
      background: linear-gradient(90deg, #ffeabc 0%, #fec64b 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
  }

  // :deep(p) {
  //   width: 387px;
  //   font-family: Alimama DongFangDaKai;
  //   font-size: 24px;
  //   font-weight: 400;
  //   line-height: 36px;
  //   text-align: center;
  //   background: linear-gradient(90deg, #ffeabc 0%, #fec64b 100%);
  //   -webkit-background-clip: text;
  //   -webkit-text-fill-color: transparent;
  // }
}
.title-box-2 {
}

.content-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 320px;
  margin-top: 95px;
  margin-left: 19px;
}
.subtitle {
  width: 100%;
  font-family: PingFang SC;
  font-size: 18px;
  color: rgba(255, 227, 162, 1);
  line-height: 28px;
  text-align: center;
}

.img-box {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 320px;
  height: 236px;
  background: linear-gradient(180deg, #f36057 0%, #df413e 100%);
  border: 1px solid rgba(255, 126, 116, 1);

  .outline-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.2);
    }
  }
}
.img-box1 {
  height: 287px;
  margin-top: 0px;
}
.img-box2 {
  height: 406px;
  margin-top: 25px;
}
.img-box3 {
  height: 406px;
  margin-top: 55px;
}

.remarks1 {
  width: 320px;
  margin-top: 20px;
  :deep(.van-text-ellipsis) {
  }
}
.remarks2 {
  width: 320px;
  margin-top: 20px;
}
.remarks3 {
  width: 320px;
  margin-top: 25px;
}
</style>